<template>
  <wl-list class="wl-content-container" :listData="myState" @pageChange="pageChange" @sizeChange="sizeChange">
    <wl-query slot="query" @doQuery="doQuery">
      <template slot="main">
          <el-form :model="mainData" class="form-query"  label-width="80px" >
            <wl-form-item :importance="false"  label="域名网址" prop="url" :itemData="mainData">
              <wl-input slot="input" slot-scope="col" class="wl-input-item" :rawData="col.columnData" field="url" placeholder="请输入域名网址"></wl-input>
            </wl-form-item>
            <wl-form-item :importance="false" label="网站名称" prop="name"   :itemData="mainData">
                <wl-arr-select :reqUrl="reqUrl" :isMore="false" slot="input" slot-scope="col" type="name"  :rawData="col.columnData"></wl-arr-select>
            </wl-form-item>
            <wl-form-item :importance="false"  label="网站状态" prop="status" :itemData="mainData">
              <wl-select slot="input" slot-scope="col" type="web_status" :code="feature_code" :rawData="col.columnData"></wl-select>
            </wl-form-item>
          </el-form>
      </template>
      <template slot="adv">
          <el-form  class="form-query" :model="advData"  label-width="80px" >
            <wl-form-item :importance="false" label="添加人" prop="create_name"   :itemData="advData">
                <wl-arr-select reqUrl="/account/list.do" :isMore="false" slot="input" slot-scope="col" type="create_name"  :rawData="col.columnData"></wl-arr-select>
            </wl-form-item>
            <wl-form-item  :importance="false" label="登录方式" prop="login_type" :itemData="advData">
                <wl-select slot="input" slot-scope="col" type="login_type" :isNoShow="true" :code="feature_code" :rawData="col.columnData"></wl-select>
            </wl-form-item>
            <wl-form-item :importance="false" label="添加日期" prop="date" :itemData="advData">
                <el-date-picker
                  v-model="advData.date"
                  slot="input" slot-scope="col"
                  :unlink-panels="true"
                  value-format ="yyyy-MM-dd HH:mm:ss"
                  :default-time="['00:00:00', '23:59:59']"
                  type="daterange"
                  range-separator="至"
                  start-placeholder="开始日期"
                  end-placeholder="结束日期">
                </el-date-picker>
            </wl-form-item>
          </el-form>
      </template>
    </wl-query>
    <wl-container slot="operator" align="right">
      <wl-tip-button icon="btn_xz1" :isNew="true"  tipsDisabled @click="doNew" label="新增"></wl-tip-button>
      <wl-tip-button icon="pop_dr"  btnType="" :isNormal="true"  tipsDisabled @click="doUpLoad" label="导入"></wl-tip-button>
      <wl-tip-button icon="btn_qy"  btnType="" :isNormal="true"  :disabled="!isQiYong" :tipsDisabled="false" @click="doQiYong" tips="停用状态下可以启用" label="启用"></wl-tip-button>
      <wl-tip-button icon="btn_ty"  btnType="" :isNormal="true"  :disabled="!isTingYong" :tipsDisabled="false" @click="doTingYong" tips="启用状态下可以停用" label="停用"></wl-tip-button>
      <wl-tip-button icon="btn_mmcz"  btnType="" :isNormal="true" setW="130" tipsDisabled :disabled="!isReset" @click="doReset" label="批量修改密码"></wl-tip-button>
      <a class="btn-download" href="static/IEXPath.exe" download ><svg-icon class="svg-download" icon-class="btn_xz" class-name="btn_xz" />下载工具</a>
    </wl-container>
    <el-table  slot="table" class="webM-table" :row-class-name="rowClassName" :data="myState.data_list" style="width: 100%" border stripe @selection-change="handleSelectionChange" @expand-change="expandChange">
      <el-table-column type="selection" width="40"></el-table-column>
        <el-table-column type="expand">
          <template slot-scope="props">
          <el-form label-position="left" inline class="demo-table-expand">
            <el-form-item label="域名网址">
              <span>{{ props.row.url }}</span>
            </el-form-item>
              <el-form-item label="网站名称">
              <span>{{ props.row.name }}</span>
            </el-form-item>
              <el-form-item label="申请人">
              <span>{{ props.row.apply_name }}</span>
            </el-form-item>
              <el-form-item label="添加人">
              <span>{{ props.row.account.name }}</span>
            </el-form-item>
              <el-form-item label="添加日期">
              <span>{{ setDate(props.row.create_date) }}</span>
            </el-form-item>
              <el-form-item label="登录方式">
              <span>{{ setVal(props.row.login_type)}}</span>
            </el-form-item>
            <el-form-item label="备注">
              <span>{{ props.row.remark}}</span>
            </el-form-item>
           </el-form>
        </template>
      </el-table-column>
      <el-table-column label="操作" width="120" class-name="operation_cell">
        <template slot-scope="scope">
          <wl-tip-button icon="btn_xq"  tips="查看" @click="rowEdit(scope.$index, scope.row)"></wl-tip-button>
          <wl-tip-button icon="btn_sq" v-if="isAdmin" tips="授权" @click="rowSet(scope.$index, scope.row)"></wl-tip-button>
        </template>
      </el-table-column>
      <el-table-column prop="status" label="网站状态">
        <template slot-scope="scope">
         <wl-status type="web_status" :label="scope.row.web_status"></wl-status>
        </template>
      </el-table-column>
      <el-table-column prop="url" label="域名网址"></el-table-column>
      <el-table-column prop="name" label="网站名称"></el-table-column>
      <el-table-column prop="account.name" label="添加人"></el-table-column>
    </el-table>
  </wl-list>
</template>
<script lang="ts" src="./web_manage.ts"></script>

<style scoped>
.btn-download {
  font-size: 14px;
  background: #fff;
  border: 1px solid #dcdfe6;
  border-color: #dcdfe6;
  color: #555555;
  text-decoration: none;
  border-radius: 3px;
  width: 100px;
  height: 28px;
  line-height: 30px;
  fill: #555555;
}

.svg-download {
  width: 25px;
  height: 25px;
  margin-right: 3px;
}

.btn-download:hover {
  color: #409eff;
  border-color: #c6e2ff;
  background-color: #ecf5ff;
}

.btn-download:hover svg {
  fill: #409eff;
}
</style>



